package com.example.datajdbc.support;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import lombok.experimental.UtilityClass;

@UtilityClass
public class Output {

    private static final Logger LOG = LoggerFactory.getLogger(Output.class);

    public static void list(final Iterable<?> categories, final String title) {
        final StringBuilder messageBuilder = new StringBuilder(String.format("==== %s ====\n", title));
        categories.forEach(category -> {
            messageBuilder.append(category.toString().replace(", ", ",\n\t"));
        });
        LOG.info(messageBuilder.toString());
    }

    public static void singleton(final Object value, final String title) {
        LOG.info("==== {} ====\n{}", title, value);
    }

}
